﻿using DJ.ZEF.ThirdParty;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using DJ.Third;
using NSJL.Biz.Background.Client;
using NSJL.Framework.Utils;
using DJ.Clients;

namespace DJ.Dialog
{
    /// <summary>
    /// UserEdit.xaml 的交互逻辑
    /// </summary>
    public partial class UserEdit : Window
    {
        public string UserId { get; set; }
        public UserEdit()
        {
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            InitializeComponent();
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }


        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click1(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(name.Text))
            {
                MessageDialog.ShowDialog("用户名不能为空");
                return;
            }
            if (string.IsNullOrWhiteSpace(code.Text))
            {
                MessageDialog.ShowDialog("卡号不能为同时为空");
                return;
            }
            this.DialogResult = true;
        }

        /// <summary>
        /// 扫描卡号
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click4(object sender, RoutedEventArgs e)
        {
            try
            {
                code.Text = null;
                code.Focus();
            }
            catch (Exception ex)
            {
                TextLogUtil.Info(ex.Message);
                MessageDialog.ShowDialog(ex.Message);
            }
        }

       
        private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            base.DragMove();
        }

        private void TextBox1_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            ComWindow.Focus(sender);
            e.Handled = true;
        }


      
    }
}
